home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / xms206.arc / CLIB.ARC / XMMLIB.DOC < prev   
Text File  |  1989-04-04  |  6KB  |  222 lines

  1.  
  2.     XMS Driver C Interface Routine Definitions
  3.  
  4.     Copyright (c) 1988, Microsoft Corporation
  5.  
  6.  
  7. All the following routines are currently available SMALL MODEL ONLY.
  8. The object code is contained in the library, XMM.LIB, XMSERROR()
  9. is a macro contained in XMM.H.
  10.  
  11. --------------------------------------------------------------------------------
  12.  
  13. unsigned    XMM_Installed();
  14.  
  15.     THIS ROUTINE MUST BE CALLED BEFORE ANY OTHER ROUTINE
  16.     OR ALL THE OTHER ROUTINES WILL FAIL WITH ERROR CODE 0x80
  17.  
  18. Returns:    1 if an XMM driver was found
  19.         0 if no driver was found
  20.  
  21. --------------------------------------------------------------------------------
  22.  
  23. long    XMM_Version();
  24.  
  25. Returns:    32 bit version, XMS version number in the low 16 bits,
  26.         Driver internal revision in the high 16 bits
  27.  
  28. --------------------------------------------------------------------------------
  29.  
  30. long    XMM_RequestHMA(Space_Needed);
  31. unsigned Space_Needed;
  32.  
  33. Parameters:    Space_Needed is the number of Kb of the high memory area
  34.         which will be used (see the XMS)
  35.  
  36. Returns:    0L    Success
  37.         < 0    Error code in top 8 bits
  38.  
  39. --------------------------------------------------------------------------------
  40.  
  41. long    XMM_ReleaseHMA();
  42.  
  43. Returns:    0L    Success
  44.         < 0    Error code in top 8 bits
  45.  
  46. --------------------------------------------------------------------------------
  47.  
  48. long    XMM_GlobalEnableA20();
  49.  
  50. Returns:    0L    Success
  51.         < 0    Error code in top 8 bits
  52.  
  53. --------------------------------------------------------------------------------
  54.  
  55. long    XMM_GlobalDisableA20();
  56.  
  57. Returns:    0L    Success
  58.         < 0    Error code in top 8 bits
  59.  
  60. --------------------------------------------------------------------------------
  61.  
  62. long    XMM_EnableA20();
  63.  
  64. Returns:    0L    Success
  65.         < 0    Error code in top 8 bits
  66.  
  67. --------------------------------------------------------------------------------
  68.  
  69. long    XMM_DisableA20();
  70.  
  71. Returns:    0L    Success
  72.         < 0    Error code in top 8 bits
  73.  
  74. --------------------------------------------------------------------------------
  75.  
  76. long    XMM_QueryA20();
  77.  
  78. Returns:    1L    Success, A20 is enabled
  79.         0L    Success, A20 is disabled
  80.         < 0    Error code in top 8 bits
  81.  
  82. --------------------------------------------------------------------------------
  83.  
  84. long    XMM_QueryLargestFree();
  85.  
  86. Returns:    >= 0L    Success, return is size of largest free block
  87.         < 0    Error code is in the top 8 bits of the return value
  88.  
  89. --------------------------------------------------------------------------------
  90.  
  91. long    XMM_QueryTotalFree();
  92.  
  93. Returns:    >= 0L    Success, return is total amount of free extended memory
  94.         < 0    Error code is in the top 8 bits of the return value
  95.  
  96. --------------------------------------------------------------------------------
  97.  
  98. long    XMM_AllocateExtended(SizeK);
  99. unsigned SizeK;
  100.  
  101. Parameters:    SizeK is the size of the block requested in Kb
  102.  
  103. Returns:    >= 0L    Success, the low word is the handle for the block
  104.         < 0    Error code is in the top 8 bits of the return value
  105.  
  106. --------------------------------------------------------------------------------
  107.  
  108. long    XMM_FreeExtended(Handle);
  109. unsigned Handle;
  110.  
  111. Parameters:    Handle is the handle corresponding to the extended memory
  112.         block to be freed
  113.  
  114. Returns:    0L    Success
  115.         < 0    Error code in top 8 bits
  116.  
  117. --------------------------------------------------------------------------------
  118.  
  119. long    XMM_MoveExtended(pMoveDescription);
  120. struct XMM_Move *pMoveDescription;
  121.  
  122. Parameters:    pMoveDescription is a pointer to a structure as defined
  123.         in the XMS.  XMM_Move is defined in XMM.H
  124.  
  125. Returns:    0L    Success
  126.         < 0    Error code in top 8 bits
  127.  
  128. --------------------------------------------------------------------------------
  129.  
  130. long    XMM_LockExtended(Handle);
  131. unsigned Handle;
  132.  
  133. Parameters:    Handle is the handle corresponding to the extended memory
  134.         block to be locked
  135.  
  136. Returns:    > 0    Success, value is the physical address of the memory
  137.         < 0    Error code in top 8 bits
  138.  
  139. NOTE:    This interface only allows 31 bits of physical address.
  140.  
  141. --------------------------------------------------------------------------------
  142.  
  143. long    XMM_UnLockExtended(Handle);
  144. unsigned Handle;
  145.  
  146. Parameters:    Handle is the handle corresponding to the extended memory
  147.         block to be unlocked
  148.  
  149. Returns:    0L    Success
  150.         < 0    Error code in top 8 bits
  151.  
  152. --------------------------------------------------------------------------------
  153.  
  154. long    XMM_GetHandleLength(Handle);
  155. unsigned Handle;
  156.  
  157. Parameters:    Handle is the handle corresponding to the extended memory
  158.         block for which the length is required
  159.  
  160. Returns:    > 0    Success, the return value is the length of the
  161.             block in Kb
  162.         < 0    Error code in top 8 bits
  163.  
  164. --------------------------------------------------------------------------------
  165.  
  166. long    XMM_GetHandleInfo(Handle);
  167. unsigned Handle;
  168.  
  169. Parameters:    Handle is the handle corresponding to the extended memory
  170.         block for which the information is required
  171.  
  172. Returns:    > 0    Success, the low byte (bits 7:0) contains the
  173.             number of free EMB handles in the system, bits 15:8 
  174.             contain the lock count for the handle
  175.         < 0    Error code in top 8 bits
  176.  
  177. --------------------------------------------------------------------------------
  178.  
  179. long    XMM_ReallocateExtended(Handle, NewSizeK);
  180. unsigned NewSizeK;
  181.  
  182. Parameters:    Handle is the handle which is to be reallocated
  183.         NewSizeK is the desired size in Kb
  184.  
  185. Returns:    0L    Success
  186.         < 0    Error code in top 8 bits
  187.  
  188. --------------------------------------------------------------------------------
  189.  
  190. long    XMM_RequestUMB(SizeP);
  191. unsigned SizeP;
  192.  
  193. Parameters:    SizeP is the size in paragraphs requested
  194.  
  195. Returns:    > 0L    Success, low word (bits 15:0) contain the segment
  196.             of the upper memory block, high word (bits 30:16)
  197.             contains the actual size of the block
  198.         < 0L    Error code in the top 8 bits, size of the largest
  199.             available block in the low word (bits 15:0)
  200.  
  201. --------------------------------------------------------------------------------
  202.  
  203. long    XMM_ReleaseUMB(Segment);
  204. unsigned Segment;
  205.  
  206. Parameters:    Segment of the upper memory block to be released
  207.  
  208. Returns:    0L    Success
  209.         < 0    Error code in top 8 bits
  210.  
  211. --------------------------------------------------------------------------------
  212.  
  213. char    XMSERROR(x)
  214. long x;
  215.  
  216. Parameters:    x is a return code from one of the XMM functions which
  217.         indicated an error
  218.  
  219. Returns:    The error code is returned as a 'char'
  220.  
  221. --------------------------------------------------------------------------------
  222.